Skip to content

[datadog_monitors] Fix datadog_monitors datasource not failing if no monitors found #2808

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 19, 2025

Conversation

ecdatadog
Copy link
Contributor

Fixes #2782

It is quite idiomatic with terraform datasources to have 2 datasources :

  • a singular one (datadog_monitor in our case) that will fails if the search criteria matches 0 or more than 1 results
  • a plural one (datadog_monitors in our case) that will not fails based on the number of items matching the search criteria as it returns an array.

this PR implement this policy if there is no monitors matched.

@morganrowse-olympus
Copy link

Thanks for the submission, this would help out with an issue I am facing with the DD tf provider.

@ecdatadog ecdatadog requested review from a team May 16, 2025 11:18
@ecdatadog ecdatadog merged commit 7b844a2 into master May 19, 2025
12 of 13 checks passed
@ecdatadog ecdatadog deleted the ec/fix_2782 branch May 19, 2025 06:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

data datadog_monitors: allow queries that do not return value(s)
4 participants